import VueCookie from "vue-cookie";
export default {
    install(Vue)  {
        Vue.prototype.access = function (options) {
            let user = JSON.parse(VueCookie.get('user'));
            let roleId = user.role_id;
            let rules = user.role_rules;
            if(roleId == 1){
                return true;
            }
            if (rules.includes(options.toString())) {
                return true;
            }
            return false;
        };
    }
}
